# Packages ----------------------------------------------------------------# using a reproducible environmentrenv::restore()# pacman allows to check/install/load packages with a single call# if (!require("pacman")) install.packages("pacman") # already in renv.locklibrary("pacman")# packages to load (and install if needed) -------------------------------pacman::p_load( here, # easy file paths see, # theme_modern and okabeito palette report, # reporting various info labelled, # labelled data# ---- packages specific to this project ---- scales, lme4, simr, readxl, openxlsx, statmod, qqplotr, emmeans, ggbeeswarm, ggpubr, patchwork, quarto, easystats,# --- tidyverse # modern R ecosystem)# Custom functions shared across scripts ----------------------------------source(here("scripts/_functions.R"))# Global cosmetic theme ---------------------------------------------------theme_set(theme_modern(base_size =14)) # from see in easystats# setting my favourite palettes as ggplot2 defaultsoptions( ggplot2.discrete.colour = scale_colour_okabeito,ggplot2.discrete.fill = scale_fill_okabeito,ggplot2.continuous.colour = scale_colour_viridis_c,ggplot2.continuous.fill = scale_fill_viridis_c)# Fixing a seed for reproducibility ---------------------------------------set.seed(14051998)# Adding all packages' citations to a .bib --------------------------------knitr::write_bib(c(.packages()), file =here("bibliography/packages.bib"))
1 Rationale
To account for the non-normal, positively skewed distributions of the RTs, we fitted Generalized Linear Mixed Models (GLMMs) with inverse Gaussian distributions. The models were implemented in the lme4 R package and integrated in tidymodels workflows using the package multilevelmod. Models with Gamma and Gaussian distributions were also fitted and compared with the AIC and BIC to ensure that we chose the best distribution available.
The models included the Group (aphantasic, control), Congruence condition (congruent or incongruent) and Color condition (color or uncolored) along with all their two and three way interactions as fixed categorical predictors, while participants have been included as grouping factors (i.e. “random effects”). The random effect structure was chosen by fitting and comparing models with every possible combination of distribution and structure (intercept by participant, congruence or color, slope by participant on congruence and/or color) aiming for the best balance between goodness of fit and parsimony. Complex random-effects structures including various slopes on the factors failed to converge to stable and reliable estimates, hence the optimal models chosen included a single by-participant random intercept.
2 Model fitting
The formula of the model fitted is \(RT \sim (aphantasia + congruence + color)^3 + (1|subjectid)\).
Figure S3.1: Model assumption checks for the Generalized Linear Mixed Model fit on the RTs in the implicit task.Figure S3.2: Model assumption checks for the Generalized Linear Mixed Model fit on the RTs in the explicit task.Figure 6.1: Subject means and model-estimated means per group and condition in the implicit task.Figure 6.2: Subject means and model-estimated means per group and condition in the explicit task.